package com.haopt.annotation.conditionexpand;

import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author haopt
 * @version 1.0
 * @ClassName ConditionalTest
 * @Description @ConditionalOnProperty(prefix = "haopt",name = "name")  配置文件中是否含有haopt前缀，name属性
 * @date 2021/5/12 15:03
 */
@Configuration
//@ConditionalOnClass(FastJsonHttpMessageConverter.class)
@ConditionalOnProperty(prefix = "data",name = "name")
public class ConditionalTestConfig {

    @Bean
    public ConditionalTest getBean(){
        return new ConditionalTest();
    }

    @Bean
    public ConditionalTest1 getBean1(){
        return new ConditionalTest1();
    }
}
